<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>学校食堂安全管理系统v1.0</title>
    <!-- Bootstrap Core CSS -->
    <link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="../vendor/metisMenu/metisMenu.min.css" rel="stylesheet">
    <!-- Custom CSS -->
    <link href="../dist/css/sb-admin-2.css" rel="stylesheet">
    <!-- Custom Fonts -->
    <link href="../vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!--日期插件样式-->
    <link rel="stylesheet" type="text/css" href="../datepicker/need/laydate.css"/>
    <!--自定义的扩展样式-->
	<link rel="stylesheet" type="text/css" href="../dist/css/extendcss.css"/>
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>
    <div id="wrapper">
        <!-- Navigation -->
        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle </span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
             
            </div>
            <!-- /.navbar-header -->

            <ul class="nav navbar-top-links navbar-right">
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-envelope fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-messages">
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <strong>John Smith</strong>
                                    <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
                                </div>
                                <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>Read All Messages</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                    <!-- /.dropdown-messages -->
                </li>
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-tasks fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-tasks">
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 1</strong>
                                        <span class="pull-right text-muted">40% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
                                            <span class="sr-only">40% Complete (success)</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 2</strong>
                                        <span class="pull-right text-muted">20% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">
                                            <span class="sr-only">20% Complete</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 3</strong>
                                        <span class="pull-right text-muted">60% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
                                            <span class="sr-only">60% Complete (warning)</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <p>
                                        <strong>Task 4</strong>
                                        <span class="pull-right text-muted">80% Complete</span>
                                    </p>
                                    <div class="progress progress-striped active">
                                        <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
                                            <span class="sr-only">80% Complete (danger)</span>
                                        </div>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>See All Tasks</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                    <!-- /.dropdown-tasks -->
                </li>
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-alerts">
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-comment fa-fw"></i> New Comment
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-twitter fa-fw"></i> 3 New Followers
                                    <span class="pull-right text-muted small">12 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-envelope fa-fw"></i> Message Sent
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-tasks fa-fw"></i> New Task
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="#">
                                <div>
                                    <i class="fa fa-upload fa-fw"></i> Server Rebooted
                                    <span class="pull-right text-muted small">4 minutes ago</span>
                                </div>
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a class="text-center" href="#">
                                <strong>See All Alerts</strong>
                                <i class="fa fa-angle-right"></i>
                            </a>
                        </li>
                    </ul>
                    <!-- /.dropdown-alerts -->
                </li>
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
                        </li>
                        <li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
                        </li>
                        <li class="divider"></li>
                        <li><a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
                        </li>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
            <!-- /.navbar-top-links -->

             <div class="navbar-default sidebar" role="navigation">
                <div class="sidebar-nav navbar-collapse">
                    <ul class="nav" id="side-menu">
                        <!--<li class="sidebar-search">
                            <div class="input-group custom-search-form">
                                <input type="text" class="form-control" placeholder="Search...">
                                <span class="input-group-btn">
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                            </div>
                        </li>-->
                        <li>
                             <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> 库存管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="receiptplanlist.html">进货计划</a>
                                </li>
                                <li>
                                    <a href="signlist.html">进货签收</a>
                                </li>
                                <li>
                                    <a href="boundin.html">入库管理</a>
                                </li>
                                <li>
                                    <a href="boundout.html">出库管理</a>
                                </li>
                                <li>
                                    <a href="inventory.html">盘点管理</a>
                                </li>                               
                            </ul>
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-bar-chart-o fa-fw"></i> 供货管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="ghsend.html">送货单管理</a>
                                </li>
                                <li>
                                    <a href="ghreceive.html">收款单管理</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                        	<a href="#"><i class="fa fa-wrench fa-fw"></i> 财务管理<span class="fa arrow"></span></a>
                        	<ul class="nav nav-second-level">
                                <li>
                                    <a href="cwreceive.html">收款管理</a>
                                </li>
                                <li>
                                    <a href="cwpay.html">付款管理</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-wrench fa-fw"></i> 统计分析<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="tjin.html">进货单查询</a>
                                </li>
                                <li>
                                    <a href="tjout.html">出库汇总表</a>
                                </li>
                                <li>
                                    <a href="tjinsum.html">入库汇总表</a>
                                </li>
                                <li>
                                    <a href="tjhasdetail.html">存货明细账</a>
                                </li>
                                <li>
                                    <a href="tjshouldpay.html"> 应付货款报告</a>
                                </li>
                                <li>
                                    <a href="tjsource.html">食材来源统计</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-sitemap fa-fw"></i>基础数据<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                                <li>
                                    <a href="unitlist.html">单位管理</a>
                                </li>
                                <li>
                                    <a href="supplierlist.html">供应商管理</a>
                                </li>
                                 <li>
                                    <a href="foodclasslist.html">菜品类别</a>
                                </li>
                                <li>
                                    <a href="foodlist.html">菜品管理</a>
                                </li>
                                <!--<li>
                                    <a href="#">Third Level <span class="fa arrow"></span></a>
                                    <ul class="nav nav-third-level">
                                        <li>
                                            <a href="#">Third Level Item</a>
                                        </li>
                                        <li>
                                            <a href="#">Third Level Item</a>
                                        </li>
                                        <li>
                                            <a href="#">Third Level Item</a>
                                        </li>
                                        <li>
                                            <a href="#">Third Level Item</a>
                                        </li>
                                    </ul>                                   
                                </li>-->
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                        <li>
                            <a href="#"><i class="fa fa-files-o fa-fw"></i> 系统管理<span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level">
                             
                                <li>
                                    <a href="userlist.html">用户管理</a>
                                </li>
                                <li>
                                    <a href="editpassword.html">修改密码</a>
                                </li>
                                 <li>
                                    <a href="log.html">日志管理</a>
                                </li>
                                <li>
                                    <a href="login.html">退出系统</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
                        </li>
                    </ul>
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper">
           <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading row">
                           	<div class="col-sm-6"> 当前位置: 财务管理 >收款管理</div>                           	
                           	
                        </div>
                        <!-- /.panel-heading -->
  						<div class="row panel-body">
                           	<form class="form-inline" role="form">
                           	  <div class="form-group">
							    <div class="input-group">
							      <div class="input-group-addon">从：</div>
							      <input class="form-control" type="text" id="datestart" placeholder="2021-8-01">
							    </div>
							  </div>
							  <div class="form-group">
							    <div class="input-group">
							      <div class="input-group-addon">到:</div>
							      <input class="form-control" type="text" id="dateend" placeholder="2021-8-02">
							    </div>
							  </div>
							  <div class="form-group">
							   <div class="input-group">
							      <div class="input-group-addon">供货商</div>
							       <select class="form-control" id="s_sendunit">
							       		<option>全部</option>
							       		<option>西南食品城</option>
										<option>毛记冒菜</option>
										<option>麻辣串串</option>
										<option>江油肥肠</option>
										<option>美蛙鱼头</option>
							        </select>
							    </div>
							  </div>
							  <div class="form-group">
							   <div class="input-group">
							      <div class="input-group-addon">签收</div>
							       <select class="form-control" id="s_signStatus">
							            <option>全部</option>
							            <option>已签收</option>
							            <option>未签收</option>
							        </select>
							    </div>
							  </div>
							  <div class="form-group">
							    <div class="input-group">
							      <input class="form-control" type="text" id="s_billnum" placeholder="单据编号..">
							    </div>
							  </div>
							  <button type="button" class="btn btn-default" id="s_search">查询</button>
							</form>
                        </div>
                        <div class="panel-body">
                        	
                            <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
                                <thead>
                                    <tr>
                                        <th class="center"><input type="checkbox" id="cball"/></th>
                                        <th>序号</th>
                                        <th>收款编号</th>
                                        <th>单据日期</th>
                                        <th>供货商</th>
                                        <th>单据金额（元）</th>
                                        <th>付款日期</th>
                                    </tr>
                                </thead>
                                <tbody id="cwRbox">
                                    <!--<tr class="odd gradeX">
                                    	<td class="center"><input type="checkbox" /></td>
                                        <td>1</td>
                                        <td><a href="cwreceivedetail.html">SHD20160515002</a></td>
                                        <td>2016-09-18</td>
                                        <td class="center">百度的度娘</td>
                                    	<td>13980</td>
                                    	<td>2016-09-18</td>                               
                                    </tr>                                 -->
                
                                </tbody>
								<tbody>
									<tr class="odd gradeX">
                                        <td colspan="5">合计</td>
                                    	<td id="ps"></td>
                                    	<td>&nbsp;</td>                               
                                    </tr>
								</tbody>
                            </table>
                            <!-- /.table-responsive -->
                             <!--<div class="row"><div class="col-sm-6"><div class="dataTables_info" id="dataTables-example_info" role="status" aria-live="polite">显示第 1 至 5 项记录，共 5 项</div></div><div class="col-sm-6"><div class="dataTables_paginate paging_simple_numbers" id="dataTables-example_paginate"><ul class="pagination"><li class="paginate_button previous disabled" aria-controls="dataTables-example" tabindex="0" id="dataTables-example_previous"><a href="#">上页</a></li><li class="paginate_button active" aria-controls="dataTables-example" tabindex="0"><a href="#">1</a></li><li class="paginate_button next disabled" aria-controls="dataTables-example" tabindex="0" id="dataTables-example_next"><a href="#">下页</a></li></ul></div></div></div>-->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                
                <!-- /.col-lg-12 -->
            </div>
           
          
          
        </div>
      

    </div>
    <!-- /#wrapper -->

    <!-- jQuery -->
    <script src="../vendor/jquery/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="../vendor/bootstrap/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="../vendor/metisMenu/metisMenu.min.js"></script>
    <script src="../dist/js/sb-admin-2.js"></script>
    <script src="../dist/js/sea.js"></script>
    <script src="../datepicker/laydate.dev.js" type="text/javascript" charset="utf-8"></script>
	<!-- 引入公共样式 -->
	<script src="../js/common.js"></script>
	<!-- 引入模板 -->
	<script src="../js/template-web.js"></script>
	<!-- js渲染模板 -->
	<script type="text/template" id="temp">
		{{each data as value index}}
		<tr class="odd gradeX">
			<td class="center"><input type="checkbox" class="ischeck" value="{{value._id}}"/></td>
			<td>{{index+1}}</td>
			<td><a href="cwreceivedetail.html#id={{value._id}}">{{value.billnum}}</a></td>
			<td>{{value.billnumdata}}</td>
			<td class="center">{{value.sendunit}}</td>
			<td>{{value.allprice}}</td>
			<td>{{value.billdate}}</td>
                                  
		</tr> 
		{{/each}}
	</script>
    <script>
		showpage()
		function showpage(){
			var datestart = $("#datestart").val();//开始时间
			var dateend = $("#dateend").val();//结束时间
			var s_sendunit = $("#s_sendunit").val();//供货商
			var s_signStatus = $("#s_signStatus").val();//签收
			var s_billnum = $("#s_billnum").val();//单据编号
			obj = {
				datestart,dateend,s_sendunit,s_signStatus,s_billnum
			}
			console.log(obj)
			$.get("/fin/cwRlist",obj,function(data){
				var html = template("temp",{data});
				$("#cwRbox").html(html);
				var allp = 0;
				for(let i = 0; i< data.length; i++){
					allp +=data[i].allprice;
				}
				$("#ps").text(allp.toFixed(2))
				console.log(data)
			})
		}
		//搜索
		$("#s_search").click(function(){
			showpage()
		})
	</script>



</body>

</html>
